package com.app.budgetbook;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import android.widget.EditText;
import android.widget.Toast;

public class Dchart extends Activity{
	
    private int f,h,t,fa,e,a;
    private int mf, mh,mt,mfa,me,ma, chat;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		 chat=Integer.parseInt(getIntent().getStringExtra("monthchat2"));    
      
       
         
      
		super.onCreate(savedInstanceState);
		WebView googleChartView = new WebView(this);
		setContentView(googleChartView);
		//String mUrl = "http://chart.apis.google.com/chart?cht=p3&chs=450x180&chd=t:"+f+","+e+","+h+","+a+","+t+","+fa+"&chco=80C65A,FF0000,ffa000&chl=Food "+f+"|Entertainment "+e+"|Health "+h+"|Accessories "+a+"|Transport "+t+"|Family "+fa;
		//googleChartView.loadUrl(mUrl);	
		
		if(chat==1)
		{
			mf= Integer.parseInt(getIntent().getStringExtra("mfood"));
			mh= Integer.parseInt(getIntent().getStringExtra("mhealth"));
			ma= Integer.parseInt(getIntent().getStringExtra("maccessories"));
			me= Integer.parseInt(getIntent().getStringExtra("mentertainment"));
			mt= Integer.parseInt(getIntent().getStringExtra("mtransport"));
			mfa= Integer.parseInt(getIntent().getStringExtra("mfamily"));
			String mUrl = "http://chart.apis.google.com/chart?cht=p3&chs=450x180&chd=t:"+mf+","+me+","+mh+","+ma+","+mt+","+mfa+"&chco=80C65A,FF0000,ffa000&chl=Food "+mf+"|Entertainment "+me+"|Health "+mh+"|Accessories "+ma+"|Transport "+mt+"|Family "+mfa;
			googleChartView.loadUrl(mUrl);			
		}
		else
		{
			f= Integer.parseInt(getIntent().getStringExtra("fextra"));
			h= Integer.parseInt(getIntent().getStringExtra("hextra"));
			a= Integer.parseInt(getIntent().getStringExtra("aextra"));
			e= Integer.parseInt(getIntent().getStringExtra("eextra"));
			t= Integer.parseInt(getIntent().getStringExtra("textra"));
			fa= Integer.parseInt(getIntent().getStringExtra("faextra"));
			String mUrl = "http://chart.apis.google.com/chart?cht=p3&chs=450x180&chd=t:"+f+","+e+","+h+","+a+","+t+","+fa+"&chco=80C65A,FF0000,ffa000&chl=Food "+f+"|Entertainment "+e+"|Health "+h+"|Accessories "+a+"|Transport "+t+"|Family "+fa;
			googleChartView.loadUrl(mUrl);	
			
		}
		
		//setContentView(R.layout.dchart);
	}
	
	

}
